$(function(){
    $.contextMenu({
        selector: '.student-context-menu',
        callback: function(key, options) {
            if(key === "edit-service") {
                window.location = 'Student.jsp?action=edit&id=' +$(this).attr("data-url");
            }else if(key === "delete-service") {
                if( confirm("Are you sure you want to delete this student?") ) {
                    window.location = 'Student.jsp?action=delete&id=' +$(this).attr("data-url");
                }
            }
        },
        items: {
            "edit-service": {name: "Edit Student", icon: "edit"},
            "delete-service": {name: "Delete Student", icon: "delete"}
        }
    });

});

$(function(){
    $.contextMenu({
        selector: '.content-context-menu',
        callback: function(key, options) {
            if(key === "edit-content") {
                window.location = 'Dashboard.jsp?view=edit-content&id=' +$(this).attr("data-url");
            }else if(key === "delete-content") {
                if( confirm("Are you sure you want to delete this artile?") ) {
                    window.location = 'Dashboard.jsp?view=delete-content&id=' +$(this).attr("data-url");
                }
            }
        },
        items: {
            "edit-content": {name: "Edit Content", icon: "edit"},
            "delete-content": {name: "Delete Content", icon: "delete"}
        }
    });
});

$( document ).ready(function() {
    $("#add-cat").click(function() {
        $("#add-cat-form").fadeIn();
    });
});